//
//  WJMainCell.m
//  JerryIos
//
//  Created by 王军 on 2018/2/1.
//  Copyright © 2018年 王军. All rights reserved.
//

#import "WJMainItemCell.h"

@interface WJMainItemCell()

@property (weak, nonatomic) IBOutlet UIImageView *iconImage;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;

@end

@implementation WJMainItemCell

+(instancetype) cellWithTableView:(UITableView *)tableView {
    static NSString *cellId = @"itemCell";
    WJMainItemCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"WJMainItemCell" owner:nil options:nil] lastObject];
    }
    return cell;
}

-(void) setItem:(WJMainItem *)item {
    _item = item;
    
    self.iconImage.image = [UIImage imageNamed:item.icon];
    self.titleLabel.text = item.title;
    self.descLabel.text = item.desc;
}

@end
